<template>
	<!-- 调用组件 -->
	<home-header></home-header>
	<home-swipers :swiperList='swiperList'></home-swipers>
	<home-icon :iconlist='iconlist'></home-icon>
    <home-Activitiy></home-Activitiy>
    <home-Local></home-Local>
    <home-Hot :hotList='hotList'></home-Hot>
	<home-Like :likeList='likeList'></home-Like>
	<home-Week :weekList='weekList'></home-Week>
    <home-Foot></home-Foot> 
</template>

<script>
	//引入Header.vue
	import HomeHeader from './pages/Header'
	import HomeSwipers from './pages/Swipers'
	import HomeIcon from './pages/Icon'
	import HomeActivitiy from './pages/Activitiy'
	import HomeLocal from './pages/Local'
	import HomeHot from './pages/Hot'
	import HomeLike from './pages/Like'
	import HomeWeek from './pages/Week'
	import HomeFoot from './pages/Foot' 
	import axios from 'axios'
	
	//导出组件HomeHeader
	export default{
		components:{
			HomeHeader,
			HomeSwipers,
			HomeIcon,
		    HomeActivitiy,
			HomeLocal,
			HomeHot,
	        HomeLike,
			HomeWeek,
			HomeFoot
		},
		data(){
			return{
				swiperList:[],//接收Swipers组件数据
				likeList:[],
				hotList:[],
				weekList:[],
				iconlist:[]
			}
		},
		mounted(){
			axios.get('./dataHome.json').then((res)=>{
				const msg=res.data.data[0];//声明变量获取请求结果里面的数据
				//空数组获取组件数组数据
				this.swiperList=msg.swiperList;
				this.likeList=msg.likeList;
				this.hotList=msg.hotList;
				this.weekList=msg.weekList;
				this.iconlist=msg.iconlist;
			})
		}
	}
</script>

<style>
</style>
